package in.careerscale.apps.ocms.dao.model;

// Generated Jul 7, 2013 10:49:55 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * OrgType generated by hbm2java
 */
@Entity
@Table(name = "org_type", catalog = "ocms", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class OrgType implements java.io.Serializable {

	private Integer id;
	private OrgType orgType;
	private String name;
	private String description;
	private Set orgTypes = new HashSet(0);
	private Set organizations = new HashSet(0);

	public OrgType() {
	}

	public OrgType(String name) {
		this.name = name;
	}

	public OrgType(OrgType orgType, String name, String description,
			Set orgTypes, Set organizations) {
		this.orgType = orgType;
		this.name = name;
		this.description = description;
		this.orgTypes = orgTypes;
		this.organizations = organizations;
	}

	public OrgType(String name, String description)
	{
		this.name = name;
		this.description = description;
	}

	public OrgType(Integer id, String name, String description)
	{
		this.name = name;
		this.description = description;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	public OrgType getOrgType() {
		return this.orgType;
	}

	public void setOrgType(OrgType orgType) {
		this.orgType = orgType;
	}

	@Column(name = "name", unique = true, nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orgType")
	public Set<OrgType> getOrgTypes()
	{
		return this.orgTypes;
	}

	public void setOrgTypes(Set<OrgType> orgTypes)
	{
		this.orgTypes = orgTypes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orgType")
	public Set<Organization> getOrganizations()
	{
		return this.organizations;
	}

	public void setOrganizations(Set<Organization> organizations)
	{
		this.organizations = organizations;
	}

}
